"use strict"

/**
 * 湖北政府采购网爬虫
 *  
 */

var Base = require("./base");
var hb_spider = new Base();
hb_spider.name = "湖北政府采购网";
//hb_spider.page = 1;

hb_spider.getPageUrl = function(pg) {
    return "http://www.ccgp-hubei.gov.cn/notice/cggg/pzbgg//index_"+ pg +".html";
};

hb_spider.getItems = function($) {
    var items = [];
    $(".news-list-content li a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text().substring(10);
        e.url = e.attr("href").substring(5);
        item.url = "http://www.ccgp-hubei.gov.cn" + e.url;
        item.source = hb_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = hb_spider;